#version 430 core

#define BLOCK_COUNT 200

layout (std140) uniform UniformParams {
	mat4 projection;
	mat4 view;
	mat4 viewProjMat;
	mat4 biasMat;
	mat4 shadowProjection;
	mat4 worldToLightMat;
	vec4 camPosition;
	vec4 lightDir;
} uParams;

layout (std140) uniform ShaderParams
{
	mat4 model[BLOCK_COUNT];
}params;

 
layout(location = 0) in vec3 position;
layout(location = 1) in unsigned int id;
layout(location = 2) in vec4 color;

out vec4 outColor;

void main(){
	
	//get position in clip space and give it to fragment shader
	mat4 model = params.model[id];
    vec4 worldPos = model * vec4(position,1);
    gl_Position = uParams.viewProjMat * worldPos;

    outColor = color;
}